//
//  WeatherLabel.m
//  MyStock
//
//  Created by 刘翔 on 2024/11/14.
//

#import "WeatherLabel.h"

@implementation WeatherLabel

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self xw_addNotificationForName:@"weather" block:^(NSNotification * _Nonnull notification) {
            NSDictionary *result = notification.userInfo;
            self.attributedText = [[NSAttributedString alloc] initWithString:result[@"weather"]];
        }];
        self.textAlignment = NSTextAlignmentRight;
    }
    return self;
}

@end
